#
#   Messages.py
#
#   This program is free software; you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation; version 2 of the License.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#
#   Copyright
#   Author: Nicholas F. Hoover
#   Contributors: Salvatore S. Gionfriddo
#   Created: 2007.07.01
#   Last Modified: 2007.07.13
#

import pygame
import hud

def printLoading(screen):
    loadingString = "Loading..."
    loadingLabel = hud.label(screen,(20,575), loadingString)
    loadingLabel.setSize(20)
    loadingLabel.draw()

def printDoneLoading(screen):
    loadingString = "Loading... DONE"
    loadingLabel = hud.label(screen,(20,575), loadingString)
    loadingLabel.setSize(20)
    loadingLabel.draw()
    pressEnterString = "Press Enter"
    pressEnterLabel = hud.label(screen,(650,575), pressEnterString)
    pressEnterLabel.setSize(20)
    pressEnterLabel.draw()
    
def printInstructions(screen):
    strings = ("Instructions:",
               "Use arrow keys to move. Additional instructions will follow each level.",
               "General control:",
               "     P: pause",
               "     F: toggle FPS display",
               "     M: toggle music",
               "     Enter: continue from instructions, un-pause",
               "     Escape: to Quit.",
               "Press Enter to Play Now. Good Luck!")

    instructionTextBox = hud.text_box(screen, (100,50), strings)
    instructionTextBox.position = ( (800 - instructionTextBox.rendered_rect.width)/2, 150)
    instructionTextBox.render()
    instructionTextBox.draw()
    
def printPaused(screen):
    strings = ["Game Paused. Press Enter to continue or Escape to quit."]
    pausedTextBox = hud.text_box(screen, (200,100), strings)
    pausedTextBox.draw()

def printGameOver(screen, score, highScore):
    strings = ["You died. :-(",
               "Press Enter to try again or Escape to quit.",
               "",
               'Your Score: ' + str(score),
               'High Score: ' + str(highScore)]
    gameOverTextBox = hud.text_box(screen, (100,200), strings)
    gameOverTextBox.position = ( (800 - gameOverTextBox.rendered_rect.width)/2, 150)
    gameOverTextBox.render()
    gameOverTextBox.draw()

    
def printLevel(screen, level, level_desc):
    strings = ['Level: ' + str(level)] + level_desc
    levelTextBox = hud.text_box(screen, (100,150), strings)

    levelTextBox.position = ( (800 - levelTextBox.rendered_rect.width)/2, 150)
    levelTextBox.render()
    levelTextBox.draw()
